//
//  QPConstHeader.h
//  QPJHLightSDK
//
//  Created by qply on 2021/4/24.
//  Copyright © 2021 Vanney. All rights reserved.
//

#ifndef QPConstHeader_h
#define QPConstHeader_h

#import "QPJHFunDataFormat.h"

#define QPFONTCuYuan @"FZCuYuan-M03S"
#define QPFONTZHENGHEI @"FZCuYuan-M03S"//@"FZZhengHeiS-B-GB"
#define QPFONTYSBTH @"YouSheBiaoTiHei"
#define QPFONTLTHGB @"FZCuYuan-M03S"//@"FZLanTingHeiS-H-GB"
#define QPFONTLTKHGBK @"Helvetica"//@"FZLanTingKanHei-R-GBK"
#define QPSDKVERSION @"2.4.3"

#define IS_LANDSCAPE UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)

#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height
#define IS_HeightInva ([UIScreen mainScreen].bounds.size.width / [UIScreen mainScreen].bounds.size.height > 1.70)
#define IS_WithInva ([UIScreen mainScreen].bounds.size.height / [UIScreen mainScreen].bounds.size.width > 1.70)

#define kScale (667.0/375.0)
#define UILan(x) UILanAdapter(x)
#define UILanRect(x,y,width,height) UILanRectAdapter(x,y,width,height)

#define cellLanHeight (367)
#define cellLanWidth (545)

#define mallCellLanHeight (440)
#define mallCellLanWidth (245)

static inline CGFloat UILanAdapter(CGFloat x) {
    if (IS_HeightInva) {
        CGFloat scale = (SCREEN_HEIGHT / 375.0);
        return scale * x;
    } else {
        CGFloat scale = (SCREEN_WIDTH / 667.0);
        return scale * x;
    }
}

static inline CGRect UILanRectAdapter(CGFloat x,CGFloat y,CGFloat width,CGFloat height) {
    return CGRectMake(UILanAdapter(x), UILanAdapter(y), UILanAdapter(width), UILanAdapter(height));
}

static inline CGFloat UIPorAdapter(CGFloat x) {
    if (IS_WithInva) {
        CGFloat scale = (SCREEN_WIDTH / 375.0);
        return scale * x;
    } else {
        CGFloat scale = (SCREEN_HEIGHT / 667.0);
        return scale * x;
    }

}

static inline CGRect UIPorRectAdapter(CGFloat x,CGFloat y,CGFloat width,CGFloat height) {
    return CGRectMake(UIPorAdapter(x), UIPorAdapter(y), UIPorAdapter(width), UIPorAdapter(height));
}


#endif /* QPConstHeader_h */


/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            佛祖保佑       永无BUG
*/
